﻿@model IEnumerable<Mvc.Models.UserRole>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>Usuario</th>
        <th>Perfil</th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem=> item.UserProfile.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem=> item.Role.RoleName)
        </td>
        
        <td>
            @Html.ActionLink("Edit", "Edit", new {  RoleId=item.RoleId ,UserId=item.UserId }) |
            @Html.ActionLink("Details", "Details", new { RoleId=item.RoleId ,UserId=item.UserId }) |
            @Html.ActionLink("Delete", "Delete", new { RoleId=item.RoleId ,UserId=item.UserId  })
        </td>
    </tr>
}

</table>
